<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"  
      xmlns:h="http://java.sun.com/jsf/html"  
      xmlns:f="http://java.sun.com/jsf/core"  
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:t="http://myfaces.apache.org/tomahawk"
      xmlns:p="http://primefaces.org/ui">  

    <ui:composition >
        <div class="span12">
            <fieldset>
                <legend><h:outputText value="THÔNG TIN GIÁO VIÊN"/></legend>
            </fieldset>
        </div>
        <div class="control-group">
            <label class="control-label" for="txtTeacherName"><h:outputText value="Họ và Tên:"/> </label>
            <div class="controls">
                <h:inputText styleClass="span4" readonly="true" id="txtTeacherName" value="#{courseManageBean.courseTeacher.firstName}"/>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="txtTeacherMobile"><h:outputText value="Mobile:"/> </label>
            <div class="controls">
                <h:inputText styleClass="span4" readonly="true" id="txtTeacherMobile"  value="#{courseManageBean.courseTeacher.mobile}"/>
            </div>
        </div>

        <t:dataTable id="tblTakenRecord" value="#{lessonRecordBean.pageData}" var="cursor" styleClass="table table-hover"
                     preserveSort="true" rows="10" sortColumn="#{lessonRecordBean.sort}" sortAscending="#{lessonRecordBean.sortAscending}"
                     rowIndexVar="rowIndex" >
            <t:column>
                <f:facet name="header">
                </f:facet>
                <t:selectOneRow groupName="selectRadioGroup2" />
            </t:column>
            <t:column>
                <f:facet name="header">
                    <t:commandSortHeader columnName="ui.id" arrow="true" styleClass="sortColumn">
                        <h:outputText value="ID"/>
                    </t:commandSortHeader>
                </f:facet>
                <h:outputText value="#{cursor.ui.id}">
                </h:outputText>
            </t:column>
            <t:column>
                <f:facet name="header">
                    <h:outputText value="No"/>
                </f:facet>
                <t:outputText value="#{(lessonRecordBean.targetPage-1)*lessonRecordBean.maximumPageSize +rowIndex+1}"/>
            </t:column>
            <t:column>
                <f:facet name="header">
                    <t:commandSortHeader columnName="ui.dateTo" arrow="true" styleClass="sortColumn">
                        <h:outputText value="Lịch Dạy"/>
                    </t:commandSortHeader>
                </f:facet>

                <h:outputText value="#{cursor.ui.dateTo}"/> 
            </t:column>
            <t:column>
                <f:facet name="header">
                    <t:commandSortHeader columnName="ui.attendedYN" arrow="true" styleClass="sortColumn">
                        <h:outputText value="Trạng Thái"/>
                    </t:commandSortHeader>                                           
                </f:facet>
                <h:outputText value="#{cursor.ui.attendedYN}"/> 
            </t:column>
            <t:column>
                <f:facet name="header">
                    <h:outputText value="Ghi Chú"/>
                </f:facet>
                <h:outputText value="#{cursor.ui.note}"/> 
            </t:column>
            <t:column>
                <f:facet name="header">
                    <t:commandSortHeader columnName="ui.lastModifiedDate" arrow="true" styleClass="sortColumn">
                        <h:outputText value="Cập Nhật"/>
                    </t:commandSortHeader>                                                                          
                </f:facet>
                <h:outputText value="#{cursor.ui.lastModifiedDate}"/> 
            </t:column>
            <f:facet name="footer">
                <div class="row">
                    <div class="span6" style="padding-left: 30px">
                        <t:div styleClass="pagination pagination-left">
                            <ul>
                                <li>
                                    <t:commandLink  value="Xem"/>
                                </li>
                                <li>
                                    <t:commandLink  value="Sửa" action="#{courseManageBean.preUpdateCourseTeacherAttend}"/>
                                </li>
                                <li>
                                    <t:commandLink  value="Xóa" action="#{courseManageBean.deleteCourseTeacherAttend}"/>
                                </li>
                                <li>
                                    <t:commandLink disabled="#{courseManageBean.courseTeacher.firstName==null}" value="Chấm Công" action="#{courseManageBean.preCourseTeacherAttend}"/>
                                </li>
                                <li>
                                    <t:commandLink  value="Print" />
                                    
                                </li>

                            </ul>
                        </t:div>
                    </div>
                    <div class="span6">
                        <t:div styleClass="pagination pagination-right">
                            <ul>
                                <li>
                                    <t:commandLink  value="Previous"
                                                    disabled="#{!lessonRecordBean.hasPreviousPage}"
                                                    action="#{lessonRecordBean.previousPage}"/>
                                </li>

                                <li>
                                    <t:commandLink  value="Next"
                                                    disabled="#{!lessonRecordBean.hasNextPage}"
                                                    action="#{lessonRecordBean.nextPage}" />
                                </li>
                                <li class="active"> <a href="#"><t:outputText value="#{lessonRecordBean.rowCount} row(s)"/></a>
                                </li>
                            </ul>
                        </t:div>
                    </div>
                </div>

            </f:facet>
        </t:dataTable>

    </ui:composition>        

</html>  